/*
 * This file is part of ksPlatform
 * 
 * Copyright (c) 2014-2015
 * 
 * This file is dual-licensed under the AGPLv3 (http://www.gnu.org/licenses/agpl-3.0.html) 
 * 
 * If you are unsure which license is appropriate for your use, please contact the sales department
 * at 97041437@qq.com.
 */
package cn.com.ksplatform.ui.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("*.vm")
public class VelocityServlet extends HttpServlet{
	
	public static String REQUEST_URL_REQATTR = "KS_REQUEST_URL";

	/**
	 * 
	 */
	private static final long serialVersionUID = 5492836182752657082L;
	
	@Override
	protected void service(HttpServletRequest arg0, HttpServletResponse arg1)
			throws ServletException, IOException {
		String url = arg0.getRequestURI();
		arg0.setAttribute(REQUEST_URL_REQATTR, url);
		arg0.getRequestDispatcher("/modules/ui/velocity/loadPage.do").forward(arg0, arg1);
	}
}
